package com.ruoyi.organization.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.organization.mapper.BaseStorehouseMapper;
import com.ruoyi.organization.domain.BaseStorehouse;
import com.ruoyi.organization.service.IBaseStorehouseService;

/**
 * 库别管理Service业务层处理
 * 
 * @author hango
 * @date 2025-10-10
 */
@Service
public class BaseStorehouseServiceImpl implements IBaseStorehouseService 
{
    @Autowired
    private BaseStorehouseMapper baseStorehouseMapper;

    /**
     * 查询库别管理
     * 
     * @param id 库别管理主键
     * @return 库别管理
     */
    @Override
    public BaseStorehouse selectBaseStorehouseById(Long id)
    {
        return baseStorehouseMapper.selectBaseStorehouseById(id);
    }

    /**
     * 查询库别管理列表
     * 
     * @param baseStorehouse 库别管理
     * @return 库别管理
     */
    @Override
    public List<BaseStorehouse> selectBaseStorehouseList(BaseStorehouse baseStorehouse)
    {
        return baseStorehouseMapper.selectBaseStorehouseList(baseStorehouse);
    }

    /**
     * 新增库别管理
     * 
     * @param baseStorehouse 库别管理
     * @return 结果
     */
    @Override
    public int insertBaseStorehouse(BaseStorehouse baseStorehouse)
    {
        baseStorehouse.setCreateTime(DateUtils.getNowDate());
        return baseStorehouseMapper.insertBaseStorehouse(baseStorehouse);
    }

    /**
     * 修改库别管理
     * 
     * @param baseStorehouse 库别管理
     * @return 结果
     */
    @Override
    public int updateBaseStorehouse(BaseStorehouse baseStorehouse)
    {
        baseStorehouse.setUpdateTime(DateUtils.getNowDate());
        return baseStorehouseMapper.updateBaseStorehouse(baseStorehouse);
    }

    /**
     * 批量删除库别管理
     * 
     * @param ids 需要删除的库别管理主键
     * @return 结果
     */
    @Override
    public int deleteBaseStorehouseByIds(Long[] ids)
    {
        return baseStorehouseMapper.deleteBaseStorehouseByIds(ids);
    }

    /**
     * 删除库别管理信息
     * 
     * @param id 库别管理主键
     * @return 结果
     */
    @Override
    public int deleteBaseStorehouseById(Long id)
    {
        return baseStorehouseMapper.deleteBaseStorehouseById(id);
    }
}
